Skip to content

Membrane support#1561

Open
hannahbaumann wants to merge 128 commits intomainfrom
membrane_prototype
Open

Membrane support#1561
hannahbaumann wants to merge 128 commits intomainfrom
membrane_prototype

Conversation

@hannahbaumann
Copy link
Contributor

@hannahbaumann hannahbaumann commented Oct 9, 2025

@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 98.55491% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.23%. Comparing base (3d65447) to head (683b47d).

Files with missing lines Patch % Lines
openfe/protocols/openmm_md/plain_md_methods.py 80.00% 2 Missing ⚠️
openfe/protocols/openmm_utils/system_validation.py 81.81% 2 Missing ⚠️
...nfe/protocols/openmm_septop/equil_septop_method.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1561      +/-   ##
==========================================
- Coverage   95.39%   93.23%   -2.17%     
==========================================
  Files         189      189              
  Lines       16646    16922     +276     
==========================================
- Hits        15880    15777     -103     
- Misses        766     1145     +379     
Flag Coverage Δ
fast-tests 93.23% <98.55%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hannahbaumann hannahbaumann requested a review from IAlibay January 22, 2026 09:46
@hannahbaumann hannahbaumann changed the title [ WIP ] Membrane support Membrane support Feb 11, 2026
@hannahbaumann
Copy link
Contributor Author

pre-commit.ci autofix

@github-actions
Copy link

No API break detected ✅

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An initial look through - I can't work out why that one energy test is causing a mismatch, there's no direct reason why it should be happening, it looks like it needs dissecting manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you zip this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be zipped too?

self.settings.integrator_settings.timestep,
self.settings.complex_integrator_settings.timestep,
)
settings_validation.validate_timestep(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
settings_validation.validate_timestep(
settings_validation.validate_timestep(

@@ -382,12 +383,28 @@ class IntegratorSettings(SettingsBaseModel):
"""
constraint_tolerance: float = 1e-06
"""Tolerance for the constraint solver. Default 1e-6."""
barostat: Literal["MonteCarloBarostat", "MonteCarloMembraneBarostat"] = "MonteCarloBarostat"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you haven't already, please raise an issue and add it to the 2.0 milestone.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zip this file?

"""
assert sampler.is_periodic
assert isinstance(sampler, MultiStateSampler)
assert isinstance(sampler._thermodynamic_states[0].barostat, MonteCarloBarostat)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not do the barostat_by_phase here and avoid re-implementing in the child class?

def _check_box_vectors(self, system):
self._test_orthogonal_vectors(system)

def _verify_sampler(self, sampler, phase: str, settings):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above re: avoiding re-implementing here.

assert pytest.approx(geom[0][0].phi_C0) == -1.068226 * offunit.radian


class TestA2AMembraneDryRun:
Copy link
Member

@IAlibay IAlibay Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark this as slow? - it's running for 526.53s on the CI runners.

assert pytest.approx(prop_chgs[i]) == offsets[2]


class TestA2AMembraneDryRun(TestT4LysozymeDryRun):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark as slow?

return s

@pytest.fixture(scope="class")
def dag(self, protocol, a2a_ligands, a2a_protein_membrane_component):
Copy link
Member

@IAlibay IAlibay Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not immediately clear to me why the energy dissection is failing - there's nothing that should be causing this unless the ligand indices are being poorly handled.

I'm wondering if one of the forces is accumulating some excess energy somehow :/

Edit: see my next comment - it seems like an issue with the non-Reference platforms.

assert pytest.approx(prop_chgs[i]) == offsets[2]


class TestA2AMembraneDryRun(TestT4LysozymeDryRun):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I managed to debug this a bit more, if I set the global alchemy platform to the Reference one here: https://github.com/choderalab/openmmtools/blob/main/openmmtools/tests/test_alchemy.py#L57 the test passes.

However, if I set it to any other platform it fails - I suspect this is a deeper issue with OpenMM.

Note: tested on OpenMM 8.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Membrane: Add warning/validation for barostat usage

3 participants